<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>商品品牌管理</title>
<#include "../common/header.ftl"/>

    <link rel="stylesheet" href="/bootstrap/css/bootstrap.css">
    <script type="text/javascript" src="/js/plugins/fancybox/jquery.fancybox.js"></script>
    <script type="text/javascript" src="/bootstrap/js/jquery.form.js"></script>
    <link type="text/css" rel="stylesheet" href="/js/plugins/uploadifive/uploadifive.css" />
    <script type="text/javascript" src="/js/plugins/uploadifive/jquery.uploadifive.min.js"></script>
    <link rel="stylesheet" href="/bootstrap/css/qunit-1.11.0.css">
    <script type="text/javascript" src="/bootstrap/js/qunit-1.11.0.js"></script>
    <script type="text/javascript" src="/bootstrap/js/bootstrap-paginator.js"></script>
    <script type="text/javascript" src="/js/plugins/My97DatePicker/WdatePicker.js"></script>
    <link type="text/css" rel="stylesheet" href="/js/plugins/bootstrap-select/css/bootstrap-select.css" />
    <script type="text/javascript" src="/js/plugins/bootstrap-select/js/bootstrap-select.js"></script>


<script type="text/javascript">
	$(function() {
		$("#query").click(function(){
			$("#currentPage").val(1);
			$("#searchForm").submit();
		})
        //-----格林威治时间转化为yyyy-MM-dd 的转换函数----------
        Date.prototype.format = function(format)
        {
            var o = {
                "M+" : this.getMonth()+1, //month
                "d+" : this.getDate(), //day
                "h+" : this.getHours(), //hour
                "m+" : this.getMinutes(), //minute
                "s+" : this.getSeconds(), //second
                "q+" : Math.floor((this.getMonth()+3)/3), //quarter
                "S" : this.getMilliseconds() //millisecond
            }
            if(/(y+)/.test(format))
                format=format.replace(RegExp.$1,(this.getFullYear()+"").substr(4 - RegExp.$1.length));
            for(var k in o)
                if(new RegExp("("+ k +")").test(format))
                    format = format.replace(RegExp.$1,RegExp.$1.length==1 ? o[k] : ("00"+ o[k]).substr((""+ o[k]).length));
            return format;
        }

        function chGMT(gmtDate){
            var mydate = new Date(gmtDate);
            mydate.setHours(mydate.getHours());
            return mydate.format("yyyy-MM-dd hh:mm:ss");
        }


       //列表页面Bootstrap分页---------------
        var element = $('#pagination');
        var options = {
            bootstrapMajorVersion:3,
            currentPage:    ${pageResult.currentPage!""},       //当前页
            numberOfPages:  6,                                  //设置控件显示的页码数.即：类型为"page"的操作按钮的数量
            totalPages:     ${pageResult.totalPage!""},         //总页数
            size:'14px',                                        //大小
            alignment:'center',                                 //位置
            pageUrl: function(type, page, current){             //访问连接[]
                return "#"+page;
            },
            itemTexts: function (type, page, current) {        //样式文字设置
                switch (type) {
                    case "first":
                        return "首页";
                    case "prev":
                        return "前一页";
                    case "next":
                        return "下一页";
                    case "last":
                        return "最后";
                    case "page":
                        return ""+page;
                }
            },
            shouldShowPage:function(type, page, current){//控制哪些显示，哪些隐藏
                switch(type) {
                    case "first":
                    case "last":
                        return false;  //首页最后一页隐藏
                    default:
                        return true;  //其他显示
                }
            },
            tooltipTitles: function (type, page, current) { //提示框，当鼠标放上去给提示
                switch (type) {
                    case "first":
                        return "提示首页";
                    case "prev":
                        return "提示前页";
                    case "next":
                        return "Tooltip for next page";
                    case "last":
                        return "Tooltip for last page";
                }
            },
            useBootstrapTooltip:true,
            onPageClicked: function(e,originalEvent,type,page){
                $("#currentPage").val(page);   //type是first,pre 等,  page是需要提交的页码
                $("#searchForm").submit();    //提交查询
            }
        }
        element.bootstrapPaginator(options);   //渲染


        //查看商品信息
        $(".seeReturnProductdetail").click(function(){
            var datas = $(this).data("json");
            window.location.href="/orderinfo/productReturnDetail?id="+datas.id;
        });



         //查看退货详情
        $(".seeReturnProduct").click(function() {
            $("#brandEditForm").clearForm(true);
            var datas = $(this).data("json");

            $("#orderSn").html("订 单 号 :"+datas.orderSn);
            $("#consignee").html("购 货 人 :"+datas.consignee);
            $("#orderTime").html("下单时间 :"+ chGMT(datas.orderTime));
            $("#payTime").html("支付时间 :"+ chGMT(datas.payTime));
            $("#sendTime").html("发货时间 :"+ chGMT(datas.sendTime));
            var address =datas.country+"  "+datas.province+"  "+"(省/自治区(不含港澳台)"+"  "+datas.city+"  "+"(市/自治州)"+"  "+datas.district+"  "+"(区/县)"+"  "+"  "+datas.address;
            $("#address").html("配送地址 :"+address);
            $("#zipcode").html("邮编编码 :"+datas.zipcode);  //邮编
            $("#deliverType").html("配送方式: 默认快递");
            $("#deliver").html("配 送 员: 马 云");
            $("#deliverFee").html("配送费用: 10.00 元");
            $("#deliverPhone").html("配送员电话: 1996666888");
            $("#returntime").html("退货时间 :"+ chGMT(datas.returnTime));
            $("#deliverSn").html("退货单号 :"+datas.deliverSn);          // 快递单号
            $("#orderAmount").html("订单数量 :"+datas.orderAmount);      //订单数量
            $("#isinsurance").html("是否保价：是 ");  //商品数量
            $("#goodsAmount").html("商品数量 :"+datas.goodsAmount);      //商品数量
            $("#insuranceFee").html("保价费用: 10.00 元 ");
            $("#receiver").html("收货人 :" +datas.consignee);
            $("#email").html("电子邮箱 :" );
            $("#returnaddress").html("地址详情 :"+ address);
            $("#moble").html("联系电话 :"+datas.mobile );
            $("#dliverFee").html("配送费用 :10.00 元");
            $("#perfectdlivertime").html("最佳配送时间 :工作时间之内");
            $("#userRemark").html("客 户 留 言 : ");
           $("#myModal").modal("show");
        })

        //取消
        $("#cancel").click(function(){
            $("#myModal").clearForm();
            $("#myModal").modal("hide");
            return false;
        });
        //-----------------------

        //返回列表
        $("#goback").click(function(){
            $("#myModal").modal("hide");
            window.location.href="/orderinfo/productReturn";
        });
	});
</script>
</head>
<body>

<div id="alert-content"></div>
<div id="alert-content"></div>

<div class="container">
		<#include "../common/top.ftl"/>
		<div class="row">
			<div class="col-sm-3">
				<#include "../common/menu.ftl" />
			</div>
			<div class="col-sm-9">
				<div class="page-header">
					<h3>退货列表管理</h3>
                </div>
				<form id="searchForm" class="form-inline" method="post" action="/orderinfo/productReturn">
					<input type="hidden" id="currentPage" name="currentPage" value=""/>
					<div class="form-group">
                        <input type="text" class="form-control" value="${qo.keyword!''}"  name="keyword" name="keyword"
							    placeholder="收货人/订单号" style="background-color: #eefbbb; padding-right: 140px" >
						<button id="query" class="btn btn-success"><i class="icon-search"></i> 查 询</button>
					</div>
				</form>

				<div class="panel panel-default">
					<table class="table">
						<thead>
							<tr align="center">
								<th>订单号</th>
								<th>收货人</th>
								<th>下单时间</th>
								<th>发货时间</th>
								<th>退货时间</th>
                                <th>商品信息</th>
								<th>退货查看</th>
							</tr>
						</thead>
						<tbody>

						<#list pageResult.data as info>
							<tr align="center">
								<td style="padding-top: 25px">${info.orderSn}</td>
								<td style="padding-top: 25px">${info.consignee!""}</td>
								<td style="padding-top: 25px">${info.orderTime ?string('yyyy-MM-dd HH:mm:ss')}</td>
								<td style="padding-top: 25px">${info.sendTime ?string('yyyy-MM-dd HH:mm:ss')}</td>
								<td style="padding-top: 25px">${info.returnTime ?string('yyyy-MM-dd HH:mm:ss')}</td>
                                <td style="padding-top: 20px">
                                    <a href="javascript:void(-1);" class="seeReturnProductdetail"  data-json='${info.jsonString}'><img border="0" src="/images/商品.png" /></a>
                                </td>
								<td style="padding-top: 20px">
                                    <a href="javascript:void(-1);" class="seeReturnProduct"  data-json='${info.jsonString}'><img border="0" src="/images/查看.png" /></a>
                                </td>
							</tr>
						</#list>
						</tbody>
					</table>

                    <!--此处分页-->
                    <div style="text-align: center;">
						<ul id="pagination" class="pagination"></ul>
					</div>
				</div>
			</div>
		</div>
        <#--=======弹出框===========-->
            <div class="modal fade" id="myModal" tabindex="-1" role="dialog">
                <div class ="modal-dialog modal-lg" role="document">
                    <div class="modal-content">
                        <div class="modal-body">
                            <form class="form-horizontal brandEditForm" id="brandEditForm" method="post" action="/editBrand">
                                <fieldset>
                                    <div id="legend" class="">
                                        <legend>当前退货基本信息</legend>
                                    </div>
                                    <h4 style="padding-left: 20px"><img border="0" src="/images/car.png"/>  退货基本信息</h4>
                                    <hr style="background-color: #263bc9">

                                    <input type="hidden" name="id" id="id" value="" />

                                    <div class="row" style="padding-bottom: 15px; padding-left: 40px;">
                                        <div class="col-sm-4" >
                                            <div style="padding-bottom: 5px" id="orderSn">订单号</div>
                                        </div>
                                        <div class="col-sm-4" >
                                            <div style="padding-bottom: 5px" id="consignee">购货人</div>
                                        </div>
                                        <div class="col-sm-4" >
                                            <div style="padding-bottom: 5px" id="orderTime">下单时间:</div>
                                        </div>
									</div>
                                    <div class="row" style="padding-bottom: 15px; padding-left: 40px; ">
                                        <div class="col-sm-4" >
                                            <div style="padding-bottom: 5px" id="payTime">支付时间:</div>
                                        </div>
                                        <div class="col-sm-4" >
                                            <div style="padding-bottom: 5px" id="sendTime">发货时间:</div>
                                        </div>
                                        <div class="col-sm-4" >
                                            <div style="padding-bottom: 5px" id="deliverType">配送方式: 快 递 </div>
                                        </div>
                                    </div>

                                    <div class="row" style="padding-bottom: 15px; padding-left: 40px; ">
                                        <div class="col-sm-4" >
                                            <div style="padding-bottom: 5px" id="deliverFee" >配送费用: 10.00 元</div>
                                        </div>
                                        <div class="col-sm-4" >
                                            <div style="padding-bottom: 5px" id="deliver" > 配 送 员: 马 云</div>
                                        </div>
                                        <div class="col-sm-4" >
                                            <div style="padding-bottom: 5px" id="deliverPhone">配送员电话: 1996666888</div>
                                        </div>
                                    </div>
                                    <div class="row" style="padding-bottom: 15px; padding-left: 40px; ">
                                        <div class="col-sm-12" >
                                            <div style="padding-bottom: 5px" id="address">配送地址:</div>
                                        </div>
                                    </div>
                                    <div class="row" style="padding-bottom: 15px; padding-left: 40px; ">
                                        <div class="col-sm-4" >
                                           <div style="padding-bottom: 5px"  id="returntime">退货时间: </div>
                                        </div>
                                        <div class="col-sm-4" >
                                            <div style="padding-bottom: 5px" id="deliverSn" >退货单号: </div>
                                        </div>
                                        <div class="row" style="padding-bottom: 15px; padding-left: 40px; ">
                                            <div class="col-sm-4" >
                                                <div style="padding-bottom: 5px" id="insuranceFee">保价费用: 10.00</div>
                                            </div>
                                        </div>
                                    </div>


                                    <hr>
                                    <h4 style="padding-left: 20px"><img border="0" src="/images/people.png"/>收货人信息</h4>
                                    <hr style="background-color: #263bc9">
                                    <div class="row" style="padding-bottom: 15px; padding-left: 40px;">
                                        <div class="col-sm-4" >
                                            <div style="padding-bottom: 5px" id="receiver">收 货 人:</div>
                                        </div>
                                        <div class="col-sm-4" >
                                            <div style="padding-bottom: 5px" id="email">电子邮箱:</div>
                                        </div>
                                        <div class="col-sm-4" >
                                            <div style="padding-bottom: 5px" id="zipcode">邮编编码:</div>
                                        </div>
                                    </div>
                                        <div class="row" style="padding-bottom: 15px; padding-left: 40px; ">
                                            <div class="col-sm-12" >
                                                <div style="padding-bottom: 5px" id="returnaddress">地址详情:</div>
                                            </div>
                                        </div>

                                    <div class="row" style="padding-bottom: 15px; padding-left: 40px; ">
                                        <div class="col-sm-4" >
                                            <div style="padding-bottom: 5px" id="moble">联系电话:</div>
                                        </div>
                                        <div class="col-sm-4" >
                                            <div style="padding-bottom: 5px" id="dliverFee">配送费用:</div>
                                        </div>
                                        <div class="col-sm-4" >
                                            <div style="padding-bottom: 5px" id="userRemark">客 户 留 言:</div>
                                        </div>
                                    </div>
<#--
                                    <hr>
                                    <h4 style="padding-left: 20px"><img border="0" src="/images/recorde.png"/><a href="/orderinfo/productReturnDetail">商品信息.操作记录</a></h4>
                                    <hr style="background-color: #263bc9">-->
                                </fieldset>
                            </form>
                        </div>

                    <#-- <h4 style="padding-left: 20px"><img border="0" src="/images/recorde.png"/></h4>
                     <hr style="background-color: #263bc9">
                     <#--<dlass="panel panel-default">
                         <table class="table">
                             <thead>
                             <tr align="center">
                                 <th>操作者</th>
                                 <th>订单状态</th>
                                 <th>付款状态</th>
                                 <th>操作时间</th>
                             </tr>
                             </thead>
                             <tbody>

                             <#list orderActions as info>
                             <tr>
                                 <td style="padding-top: 25px">${info.actionUser}</td>
                                 <td style="padding-top: 25px">${info.orderStatusDisplay!""}</td>
                                 <td style="padding-top: 25px">${info.shippingStatusDisplay!""}</td>
                                 <td style="padding-top: 25px">${info.actionTime?string('yyyy-MM-dd')}</td>
                             </tr>
                             </#list>
                             </tbody>
                         </table>
                     </div>
-->
                  <div align="center" style="padding-top: 20px;padding-bottom: 40px">
                        <button type="button" class="btn btn-info" id="cancel">关闭窗口</button>
                        <button type="button" class="btn btn-info" id="goback">返回列表</button>
				  </div>
                    </div>
                </div>
            </div>

	</div>
</body>
</html>